package com.gm.blog.enums;

import lombok.Getter;

/**
 * 返回结果枚举
 */
@Getter
public enum ResultEnum {
    /**
     * 返回结果枚举，每个枚举都有一个返回状态
     * 2开头的都是成功
     * 4开头的都是失败
     */
    SUCCESS(20000,"操作成功"),
    ERROR(40000,"操作失败"),
    DATA_NOT_FOUND(40001,"数据找不到"),
    PARAMS_NULL(40002,"参数不能为空"),
    NOT_LOGIN(40003,"当前账号未登录"),
    PARAMS_ERROR(40004,"参数不合法")

    ;
    //状态码
    private Integer code;
    //状态信息
    private String msg;

    ResultEnum(Integer code,String msg){
        this.code=code;
        this.msg=msg;
    }
}
